﻿@model  List<ArticleModel>

@if (Model.Count > 0)
{
    foreach (var item in Model)
    {
        <div class="home-blogs">
            <div class="home-blogs-uhead">
                <a title="进入@(item.Account.NickName)的博客" href="@Url.Action("index", "blog", new { username = item.AccountId })">
                    @if (item.Account.HeadId.HasValue && item.Account.HeadId.Value > 0)
                    {
                        <img src="@Url.Action("GetUserHeadByUid", "account", new { uid = item.AccountId })">
                    }
                    else
                    {
                        <img src="~/Content/Images/zanwutouxiang.jpg" />
                    }    
                </a>
            </div>
            <div class="home-blogs-body">
                <h3><a target="_blank" href="@Url.Content("~/"+item.AccountId+"/blog/article/"+ item.ID)">@item.Title</a></h3>
                <p class="home-blogs-body-p1">
                    @(string.IsNullOrWhiteSpace(item.Profile) ? item.Content.StripHTML().SubStr(300) : item.Profile)
                    <a target="_blank" href="@Url.Content("~/"+item.AccountId+"/blog/article/"+ item.ID)">阅读全文</a>
                </p>
                <div class="home-blogs-body-op">
                    <i class="icon-user"></i> <a href="@Url.Content("~/"+item.AccountId)" class="origin">@item.Account.NickName</a>&nbsp;&nbsp;<i class="icon-time"></i> @(item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"))&nbsp;
                    <p class="autor">
                        <span><i class="icon-eye-open"></i> 浏览(<a target="_blank" href="@Url.Content("~/"+item.AccountId+"/blog/article/"+ item.ID)">@item.ReadCount</a>)</span>
                        <span><i class="icon-comments"></i> 评论(<a target="_blank" href="@Url.Content("~/"+item.AccountId+"/blog/article/"+ item.ID)">@item.ArticleCommentModels.Count</a>)</span>
                    </p>
                </div>
            </div>
        </div>
    }
}
else
{
    <div class="dv-none-tip">暂无动态~</div>
}
<input type="hidden" id="hTotalPage" value="@ViewBag.totalPage" />